<%@ page language="java" import="java.util.*" import="org.hibernate.Session" import="hibernate.*" import="perInfo.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>房屋信息</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="css/style.css"/>
	<script  type="text/javascript" src="js/menu1.js"></script>

  </head>
  
  
  
  
  <body>
  <div id="mainblock">
  <div id="innerblock">
    <div id="toppanel">
    <div class="fp_menutile"> 
    <a href="front.jsp" class="menu1">首 页</a> <img src="images/tp_divider.gif" width= "2" height="19" alt="" class="tp_divider" /> 
    <a href="#" class="menu2">发布房屋</a> <img src=    "images/tp_divider.gif" width="2" height="19" alt="" class="tp_divider" /> 
    <a href="tenant-cart.html" class="menu2"> 收藏夹</a> <img src="images/tp_divider.gif" width="2" height="19" alt="" class="tp_divider" /> 
    <a href= "#" class="menu2">我的给力租</a> <img src="images/tp_divider.gif" width="2" height="19" alt="" class="tp_divider" /> 
    <a href="#" class="menu2">搜索</a> <img src="images/tp_divider.gif" width="2" height= "19" alt="" class="tp_divider" />
    <a href="#" class="menu2">管理中心</a> <img src="images/tp_divider.gif" width="2" height="19" alt="" class="tp_divider" />  
    <a href="#" class="menu2"> 联系我们</a> </div>
    <div class="tp_heading"><img src="images/geilizu.jpg" width="192" height="90" alt="" class="logo_image" />
    <div class="fp_shoppingbg"> 
    <div class="tp_txt3">
    <%	String user=UserCookie.getUserCookie(request,"HLSSUSER_NAMECOOKIE");
    	if(user==null){
    %>
    <a href="login.jsp">登录</a>&nbsp; &nbsp; &nbsp; &nbsp;<a href="register.jsp">注册</a>
    <%	}
    	else{
    %>
    	您好，<%=user %>&nbsp; &nbsp; &nbsp; &nbsp;<a href="exit.do">退出</a>
    <%	}%>
    </div>
    </div> </div>
    </div>
    <div class="contentblock">
        <form id="form1" name="form1" method="post" action="search.do">
          <label for="textfield"></label>
          <input type="text" name="description" id="textfield" value="" maxlength="300" size="60" class=
          "gh-tb" autocomplete="OFF"/>
          <label class="lab">地区</label>
          <select name="district" id="_sacat" class="gh-sb">
            <option value="所有地区" selected="selected">所有地区</option>
            <option value="1">黄浦区</option>
            <option value="2">卢湾区</option>
            <option value="3">徐汇区</option>
            <option value="4">长宁区</option>
            <option value="5">静安区</option>
            <option value="6">普陀区</option>
            <option value="7">闸北区</option>
            <option value="8">虹口区</option>
            <option value="9">杨浦区</option>
            <option value="10">闵行区</option>
            <option value="11">宝山区</option>
            <option value="12">嘉定区</option>
            <option value="13">浦东新区</option>
            <option value="14">金山区</option>
            <option value="15">松江区</option>
            <option value="16">青浦区</option>
            <option value="17">奉贤区</option>
            <option value="18">崇明县</option>
          </select>
          <label class="lab">类型</label>
          <select name="purpose" size="1" id="purpose" class="gh-sb" label="住房">
            <option value="0" selected="selected">住房</option>
            <option value="1">别墅</option>
            <option value="2">写字间</option>
            <option value="3">商铺</option>
          </select>
          <label class="lab">价格范围</label>
          <select name="price" size="1" id="price" class="gh-sb" label="价格范围">
            <option value="0" selected="selected">500以下</option>
            <option value="1">500-1000</option>
            <option value="2">1000-2000</option>
            <option value="3">2000-3000</option>
            <option value="4">3000-4000</option>
            <option value="5">4000-5000</option>
            <option value="6">5000以上</option>
          </select>
          <input type="submit" value="搜索" class="gh-btn" />
          <a href="#">高级搜索</a>
        </form>
     </div>
   </div>
   <div id="house_basic_info_block">
   <%	String houseId=request.getParameter("id");
   		Session sess=HibernateSessionFactory.getSession();
   		sess.beginTransaction();
   		HouseInfo house=(HouseInfo)sess.get(HouseInfo.class,houseId);
   		sess.getTransaction().commit();
   		sess.close();
   %>
        <div id="house_pic">
        <img src="images/house_picture.jpg" alt="图片位置" aligh="center"/>
        </div>  
        <div id="house_basic_info">
        <a href="#"><img src="images/rss.png"width="30"height="30"align="right"></a>
        <a href="#"><img src="images/flickr.png"width="30"height="30"align="right"></a>
        <a href="#"><img src="images/facebook.png"width="30"height="30"align="right"></a>
        <a href="#"><img src="images/twitter.png"width="30"height="30"align="right"></a>
        <a href="#"><img src="images/baidu.png"width="30"height="30"align="right"></a>
        <a href="#"><img src="images/add_to_fav.png"width="30"height="30"align="right"></a>
		<p class="house_basic_info"><br /></p>
        <p class="house_basic_info"><br />房主：<%=house.getUserInfo().getUserName() %></p>
        <p class="house_basic_info"><br />月租费用：<%=house.getUnitPrice().toString() %>￥</p>
        <p class="house_basic_info"><br />租期： <%=house.getStartTime().toString() %>~<%=house.getEndTime() %></p>
        <p class="house_basic_info"><br />允许合租：<%if(house.getJointRent()>0){ %>是<%}else{ %>否<%} %></p>
        <p class="house_basic_info"><br /><%=house.getBedroom()%>室<%=house.getHall()%>厅<%=house.getToilet()%>卫</p>
        <form action="visit.do">
        	<input type="text" value=<%=house.getHouseId()%> name="houseId" style="display:none;" />
        	<input type="submit" value="" class="visit_button"/>
        </form>
        </div>
        
        
        </div>
        
        <div class="menu_navcc">
			<div class="menu_nav clearfix">
				<ul class="nav_content">
					<li class="current"><a href="#"><span>房屋详情</span></a></li>
					<li><a href="#"><span>其他待租人</span></a></li>
					<li><a href="#"><span>评论详情</span></a></li>
					<li style="position:relative;"><a href="#" title="导航菜单"><span>新功能</span></a><em></em></li>
					<li><a href="#"><span>历史记录</span></a></li>
					<li><a href="#"><span>其他信息</span></a></li>
					<li><a href="#"><span></span></a></li>
				</ul>
			<div class="menu_nav_right">
			</div>
		</div>
		
        
        <div id="house_detaied_info_block">
                <div id="house_detailed_text_block">
                	<div class="header_of_statics">
                	房屋详细介绍:
                	</div>
                    <p><%=house.getDescription() %></p>
                </div>
        </div>
        
        
    </div>
  </div>
  </body>
</html>
